﻿@model Nutrapp.DBAL.Ingredients_Category

@{
    ViewBag.Title = "Create";
}

<div class="row">
    @using (Html.BeginForm("Create", "Category", FormMethod.Post, new { @class = "span4" }))
    {
    
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)
    
        <fieldset>
            <legend>Create Category
            </legend>
            <div class="control-group"></div>

            @{
        if (@Session["nameError"] != null)
        {
                <p style="color: red">
                    @Session["nameError"].ToString()
                </p>
            Session["nameError"] = "";

        }

        if (@Session["existingCategoryError"] != null)
        {
                <p style="color: red">
                    @Session["existingCategoryError"].ToString()
                </p>
            Session["existIngrError"] = "";
        }

        //
       // if (TempData["notice"] != null)
        //{
                //<p style="color: green">
                  //  @TempData["notice"]
               // </p>
      //  }
            }

            <div>
                <table>
                    <tr style="height: 50px">
                        <td>
                            <label>Category Name</label>
                        </td>
                        <td>
                            @Html.TextBoxFor(model => model.Name, new { maxlength = 15 })
                        </td>
                    </tr>

                </table>
            </div>

            <div style="margin-top: 20px" class="form-actions">
                <button type="submit" class="btn btn-primary">Save Changes</button>
            </div>

            <div style="margin-top: 10px">
                @Html.ActionLink("Back to List", "Index", "Ingredients")
            </div>

        </fieldset>
    }
</div>
